//数据类型验证
import {customeStruct} from '../utils';
const itf = customeStruct.interface;

export const InitData = itf({
    payload: itf({
        isDealerUser: 'boolean',
        brands: [
            itf({
                id: 'string',
                code: 'string',
                name: 'string',
            })
        ]
    })
});

export const List = itf({
    payload: itf({
        content: [itf(Object.assign({
            id: 'string',
            marketDepartmentName: 'string? | null',
            country: 'string? | null',
            dealerCode: 'string? | null',
            dealerName: 'string',
            partCode: 'string? | null',
            partName: 'string? | null',
            partCodeLocal: 'string? | null',
            partNameLocal: 'string? | null',
            year: 'number',
            month: 'number',
            partInQuantity: 'number',
            partOutQuantity: 'number',
            stockQuantity: 'number',
            purchaseCurrency: 'string? | null',
            purchasePrice: 'number? | null',
            saleCurrency: 'string? | null',
            salePrice: 'number? | null',
            updateTime: 'string? | null',
            saveTime: 'string? | null',
            status: 'number',
            rowVersion: 'string? | null',
        }))],
        totalElements: 'number',
    })
});


export const DealerList = itf({
    payload: itf({
        content: [itf({
            id: 'string',
            code: 'string',
            name: 'string'
        })]
    })
});
export const DealerSimpleList = itf({
    payload: itf({
        content: [
            itf({
                id: 'string',
                code: 'string',
                name: 'string'
            })
        ]
    })
});
